import axios from "axios";

const http = {
  get(url, params) {
    return new Promise((resolve) => {
      return axios.get(url, params).then((response) => {
        if (response.status === 200) {
          resolve(response);
        }
      });
    });
  },
  post(url, params) {
    return new Promise((resolve) => {
      return axios.post(url, params).then((response) => {
        resolve(response);
      });
    });
  },
};

export default http;
